import http from '@/service/http'
import httpTwo from '@/basic/baseHttp/index'
import type * as T from '@/types/api/index'
import { netConfigUse } from '@/stores/modules/netConfig'
const routerApi: T.IRouterApi = {
  roleList() {
    const { getNetConfig: netConfig } = netConfigUse()
    return httpTwo.request(netConfig.apis.routerAll, {})
  },
  allList() {
    return http.post('/admin/Route/allList')
  },
  add(data) {
    return http.post('/admin/Route/add', data)
  },
  edit(data) {
    return http.post('/admin/Route/edit', data)
  },
  del(ids) {
    return http.post('/admin/Route/dels', {
      ids
    })
  },
  sort(data) {
    return http.post('/admin/Route/sort', data)
  }
}

export default routerApi
